﻿package com.hindsiteinteractive.ui
{
	import flash.display.SimpleButton;
	import flash.text.TextField;
	import flash.events.MouseEvent;
	import flash.display.MovieClip;
	import gs.TweenMax;
	import gs.easing.*;
		
	/**
	 * ...
	 * @author DefaultUser (Tools -> Custom Arguments...)
	 */
	public dynamic class GlowMovieClip extends MovieClip 
	{
						
		public var blurX:Number = 6;
		public var blurY:Number = 6;
		public var time:Number = 1;
		public var strength:Number = 3;
		public var color:Number = 0xFFFFFF;
		public var _alpha:Number = 1;
		
		public function GlowMovieClip() {
			
			enable();
			
		}
				
		public function _onRollOver(e:MouseEvent):void {
			TweenMax.to(this, time, { glowFilter: {blurX:blurX, blurY:blurY, color:color,strength:strength,alpha:_alpha}, ease:Quint.easeOut} );
		}
		
		public function _onRollOut(e:MouseEvent):void {
			TweenMax.to(this, time, { glowFilter: {blurX:0, blurY:0, color:color,strength:strength,alpha:0}, ease:Quint.easeOut} );
		}
				
		public function pulseIt(n:Number, delay:Number ):void {
			TweenMax.to(this, 1.5, { glowFilter: {blurX:blurX, blurY:blurY, color:color,strength:strength-.5,alpha:_alpha}, ease:Quint.easeInOut, yoyo:n, delay:delay} );
		}
		
		public function enable():void 
		{
			addEventListener(MouseEvent.ROLL_OVER, _onRollOver, false, 0 , true);
			addEventListener(MouseEvent.ROLL_OUT, _onRollOut, false, 0 , true);
		}
		
		public function disable():void 
		{
			removeEventListener(MouseEvent.ROLL_OVER, _onRollOver);
			removeEventListener(MouseEvent.ROLL_OUT, _onRollOut);
		}
	}
		
}
	
